using System;
using System.Text.RegularExpressions;

namespace Poka_Yoke.Analysis
{
    public class Rule
    {
        private string _message;
        public string Message
        {
            get
            {
                return _message;
            }
        }

        private string _description;
        public string Description
        {
            get
            {
                return _description;
            }
        }

        private Severity _ruleSeverity;
        public Severity RuleSeverity
        {
            get
            {
                return _ruleSeverity;
            }
        }

        private Regex _pattern;
        
        public Regex Pattern
        {
            get
            {
                return _pattern;
            }
        }

        public Rule(string message, string description, Severity severity, Regex pattern)
        {
            if (string.IsNullOrEmpty(message))
            {
                throw new ArgumentNullException(message);
            }

            if (string.IsNullOrEmpty(description))
            {
                throw new ArgumentNullException(description);
            }

            if (pattern == null)
            {
                throw new ArgumentNullException("pattern");
            }

            _message = message;
            _description = description;
            _ruleSeverity = severity;
            _pattern = pattern;

        }
    }
}
